package example.chapter12.updownselect;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionSupport;

import example.chapter12.model.Flower;

public class UpdownselectTagAction extends ActionSupport{
	private List<String> checkedList;
	private List<Flower> listFlower;
	
	public String execute() throws Exception{
		listFlower = new ArrayList<Flower>();
		listFlower.add(new Flower("C", "cosmos"));
		listFlower.add(new Flower("R", "rose"));
		listFlower.add(new Flower("L", "lily"));
		
		if(checkedList != null){
			for(int i = 0; i < checkedList.size(); i++){
				System.out.println(checkedList.get(i));
			}
		}
		
		return SUCCESS;
	}

	public List<String> getCheckedList() {
		return checkedList;
	}

	public void setCheckedList(List<String> checkedList) {
		this.checkedList = checkedList;
	}

	public List<Flower> getListFlower() {
		return listFlower;
	}

	public void setListFlower(List<Flower> listFlower) {
		this.listFlower = listFlower;
	}
	
}
